<template>
  <view>
    <view class="search-box flex-b p-10-20">
      <view class="search m-r-20 t-a-c f-s-12 f-w grey-light-bg-color grey-deep-font-color b-r-5 l-h-80"
        @click="goSearch()">
        <text class=" iconfont icon-sousuo f-s-12 f-w m-r-10"></text>
        <text>{{title}}</text>
      </view>
      <view v-if="flag" class="icon" @click="goAddInput()">
        <text class="iconfont icon-fatie_icon"></text>
      </view>
    </view>
  </view>
</template>

<script>
  export default {
    props: {
      title: {
        type: String,
        default: "搜索话题"
      },
      flag: {
        type: Boolean,
        default: true
      }
    },
    name: "my-search",
    data() {
      return {

      };
    },
    methods: {
      goSearch() {
        uni.navigateTo({
          url: "/subpkg/search/search"
        })
      },
      goAddInput() {
        uni.navigateTo({
          url: "/subpkg/add-input/add-input"
        })
      }
    }
  }
</script>

<style lang="scss">
  .search-box {
    align-items: center;

    .search {
      flex: 10;
      height: 80rpx;

    }

    .icon {
      flex: 1;

      .icon-fatie_icon {
        font-size: 24px;
      }
    }

  }
</style>